---@diagnostic disable: undefined-global
local function dig_my()   --dig
	turtle.dig()
	turtle.forward()
    turtle.digUp()
    turtle.digDown()

    turtle.turnLeft()
    turtle.dig()
    turtle.forward()
    turtle.digUp()
    turtle.digDown()

    turtle.turnRight()
    turtle.turnRight()
    turtle.forward()
    turtle.dig()
    turtle.forward()
    turtle.digUp()
    turtle.digDown()

    turtle.turnLeft()
    turtle.turnLeft()
    turtle.forward()
    turtle.turnRight()
end


local function turtle_fuel()   --turtle_fuel
	print("fuel_level = "..turtle.getFuelLevel().."\n")
	print("fuel_limit = "..turtle.getFuelLimit().."\n")
	if turtle.getFuelLevel()<=12 then
		turtle.refuel(1)
	end
	
end

local function trutle_ok()
    if turtle.equipLeft() then
       return true
    else
        return false
    end    
end

local function turtle_init()    --turtle_init
	turtle.refuel(1)
    if not turtle.equipLeft() then
        shell.run("equip 1 left")
    end
end

local function turtle_loop()     --turtle_loop
    while true do
        turtle_fuel()
        dig_my()
        turtle.forward()
    end

end

turtle_init()
turtle_loop()
